home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / mus / midi / MusicXRexxMacs.lha / macros / REVERSE.mxe < prev   
Text File  |  1997-02-05  |  2KB  |  123 lines

  1. /*  reverser   */
  2. OPTIONS RESULTS
  3.  
  4. MXREQUEST "REVERSE,Esrever"
  5. if result == 0 then exit
  6. MXPOINTER "sleepy" 
  7.  
  8.  
  9.  
  10. GETBARDATA
  11.  
  12. if BARDATA.SELECT == 'NONE' then do
  13.     MXREPORT "Needs selected notes!"
  14.     exit
  15.     end
  16. else
  17.  
  18.  BEGINSCAN 'selected'
  19.  
  20. if result ~= 0 then do forever        
  21.  
  22.   NEXTEVENT                
  23.   if result == 0 then break
  24.  
  25. DUR = EVENT.STOP.CLOCKS - EVENT.START.CLOCKS
  26. SIZ = BARDATA.MEASURE
  27. ARP = SIZ - EVENT.START.CLOCKS  
  28. PAR = SIZ - ARP
  29. RAT = BARDATA.BEAT
  30. TAR = BARDATA.STEP
  31.  
  32. if EVENT.TYPE == 'NOTE' then                
  33. if EVENT.STOP.BARS = EVENT.START.BARS then do
  34. EVENT.START.CLOCKS = (SIZ - DUR) - EVENT.START.CLOCKS 
  35. EVENT.STOP.CLOCKS = (SIZ + DUR) - EVENT.STOP.CLOCKS
  36. REPLEVENT
  37. end
  38.  
  39. if EVENT.TYPE == 'NOTE' then
  40. if EVENT.STOP.BARS = EVENT.START.BARS + 1 then do
  41. EVENT.START.CLOCKS = (SIZ - ARP) - EVENT.START.CLOCKS
  42. EVENT.STOP.CLOCKS = (SIZ + ARP)-2*SIZ   
  43.  
  44.  
  45. REPLEVENT
  46. end
  47. end
  48.  
  49. ENDSCAN
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57. GETBARDATA
  58.  
  59. if BARDATA.SELECT == 'NONE' then do
  60.     MXREPORT "No events selected or marked!"
  61.     exit
  62.     end
  63. else
  64.  
  65.  BEGINSCAN 'selected'
  66.  
  67. if result ~= 0 then do forever        
  68.  
  69.   NEXTEVENT                
  70.   if result == 0 then break
  71.  
  72. DUR = EVENT.STOP.CLOCKS - EVENT.START.CLOCKS
  73. SIZ = BARDATA.MEASURE
  74. ARP = SIZ - EVENT.START.CLOCKS  
  75. PAR = SIZ - ARP
  76. RAT = BARDATA.BEAT
  77.  
  78. n = (BARDATA.STOP.BARS+1) - BARDATA.START.BARS
  79.  
  80. do z = 1 to n
  81. IF EVENT.START.BARS = (BARDATA.START.BARS - 1) + z then do 
  82. EVENT.START.BARS = EVENT.START.BARS + (2*n-(z+(z-1)))
  83. EVENT.STOP.BARS = EVENT.STOP.BARS + (2*n-(z+(z-1)))
  84. REPLEVENT
  85. end
  86. end
  87. END
  88.  
  89. ENDSCAN
  90.  
  91.  
  92. GETBARDATA
  93.  
  94. if BARDATA.SELECT == 'NONE' then do
  95.     MXREPORT "No events selected or marked!"
  96.     exit
  97.     end
  98. else
  99.  
  100.  BEGINSCAN 'selected'
  101.  
  102. if result ~= 0 then do forever        
  103.  
  104.   NEXTEVENT                
  105.   if result == 0 then break
  106.  
  107. DUR = EVENT.STOP.CLOCKS - EVENT.START.CLOCKS
  108. SIZ = BARDATA.MEASURE
  109. ARP = SIZ - EVENT.START.CLOCKS  
  110. PAR = SIZ - ARP
  111. RAT = BARDATA.BEAT
  112.  
  113. n = (BARDATA.STOP.BARS+1) - BARDATA.START.BARS
  114.  
  115. if EVENT.TYPE == 'NOTE' then do
  116. EVENT.START.BARS = EVENT.START.BARS - n
  117. EVENT.STOP.BARS = EVENT.STOP.BARS - n
  118. REPLEVENT
  119. end
  120. end
  121.  
  122. MXPOINTER 'NORMAL'
  123. EXIT